<template>
    <div>
<!--      <transition enter-active-class="animate__animated animate__fadeIn">-->
        <div class="top" v-if="tan">
            <van-icon name="warning-o" size="70" color="#f8cb86"/>
            <slot></slot>
            <van-button type="primary" block @click="ok()">确认</van-button>
        </div>
<!--      </transition>-->
    </div>
</template>

<script>
    import {mapState} from "vuex";

    export default {
        name: "Tan",
        data() {
            return {
                // tan:true,
            }
        },
        computed:{
          ...mapState(["tan"])
        },
        methods: {
            ok() {
               this.$store.commit("clicktan",false);
            }
        },
    }
</script>

<style scoped>
    .top{
        position: absolute;
        top: 30%;
        width: 18rem;
        left: 0;
        right: 0;
        margin: auto;
        animation: tipMove .4s;
        background-color: #fff;
        padding-top: .6rem;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        border: 1px;
        border-radius: .25rem;
    }
    .top p{
        font-size: 1rem;
        color: #333;
        line-height: .9rem;
        text-align: center;
        margin-top: .8rem;
        padding: 0 .4rem;
    }
    .top button{
        font-size: 1rem;
        color: #fff;
        font-weight: 700;
        margin-top: .8rem;
        background-color: #4cd964;
        width: 100%;
        text-align: center;
        line-height: 1.8rem;
        border: 1px;
        height: 40px;
        border-bottom-left-radius: .25rem;
        border-bottom-right-radius: .25rem;
    }
</style>